<?php

namespace app\model\zs;

use think\Model;

class ZsTwPrinter extends Model
{
    // 设置当前模型对应的完整数据表名称
    protected $table = 'tw_printers';

    // 设置当前模型的数据库连接
    protected $connection = 'zs';

    // 自动写入时间的类型
    protected $autoWriteTimestamp = 'datetime';

    // 定义时间戳字段名
    protected $createTime = 'create_at';
    protected $updateTime = 'update_at';

    const STATUS_ON = 1;
    const STATUS_OFF = 0;

    const DELETED_ON = 1;
    const DELETED_OFF = 0;

    public function businessModel()
    {
        return $this->belongsTo(ZsBusiness::class, 'bid', 'id');
    }

    public static function markList()
    {
        return [
            'K4-WH',
            'K4-GH',
        ];
    }

    public static function typeList()
    {
        return [
            1 => '易联云',
        ];
    }

    public static function statusRels()
    {
        return [
            self::STATUS_ON => '启用',
            self::STATUS_OFF => '禁用',
        ];
    }

    public static function statusClassRels()
    {
        return [
            self::STATUS_ON => '',
            self::STATUS_OFF => 'color-red',
        ];
    }
}
